package com.rslai.base.tool.servertest.config;

import com.rslai.base.tool.servertest.annotation.ChildrenConfig;
import com.rslai.base.tool.servertest.command.StepCommand;

import java.util.ArrayList;
import java.util.List;

public abstract class CompositeStepConfig extends StepConfig {

    @ChildrenConfig
    private List<StepConfig> childrenConfig;

    protected final List<StepCommand> createChildren() {
        List commands = new ArrayList();
        for (StepConfig config : this.childrenConfig) {
            StepCommand command = config.createCommand();
            commands.add(command);
        }
        return commands;
    }
}
